#define _CRT_SECURE_NO_WARNINGS	

int searchInsert(int* nums, int numsSize, int target)
{
    for (int i = 0; i < numsSize; i++)
    {
        if (nums[i] == target)
            return i;
        if (nums[i] > target)
        {
            if (i == 0)
                return 0;
            else
                return i;
        }
    }
    return numsSize;
}